#include <stdio.h>
#include <time.h>
#include <stdlib.h>

#include "time_helper.h"

extern void print_time()
{
	struct tm *ptm; 
	long ts; 
	int y,m,d,h,n,s; 

	ts = time(NULL); 
	ptm = localtime(&ts); 

	y = ptm->tm_year+1900; //年 
	m = ptm->tm_mon+1; //月 
	d = ptm->tm_mday; //日 
	h = ptm->tm_hour; //时 
	n = ptm->tm_min; //分 
	s = ptm->tm_sec; //秒

	printf("%04d-%02d-%02d %02d:%02d:%02d\n",y,m,d,h,n,s);
}

int get_time_second()
{
	struct tm *ptm; 
	long ts; 
	int y,m,d,h,n,s; 

	ts = time(NULL); 
	ptm = localtime(&ts); 

	y = ptm->tm_year+1900; //年 
	m = ptm->tm_mon+1; //月 
	d = ptm->tm_mday; //日 
	h = ptm->tm_hour; //时 
	n = ptm->tm_min; //分 
	s = ptm->tm_sec; //秒

	return n;
}

